]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Use gjs smart GObject GTypeName computation
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 28 Oct 2019 17:44:24 +0000 (18:44 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 29 Oct 2019 18:38:35 +0000 (18:38 +0000)
Make gjs to compute the GType name for registered GObject-derived
classes using the file basename and the first directory name, so that we
can avoid name clashing, and ensure that no extension will break the
shell by registering a name that is already used (by the shell or by any
other extension).

This requires gjs commit 02568304 [1] that will be part of release 3.35.2,
so bump the required version as gjs does post-release version bumps.

[1] https://gitlab.gnome.org/GNOME/gjs/merge_requests/337

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/790

js/ui/environment.js
meson.build

index 20b546844dffab083b4c9c7fe9b5bf416fab4133..692bc0e68b6051d365142442b0e80e652274766a 100644 (file)
@@ -10,7 +10,7 @@ imports.gi.versions.Gtk = '3.0';
 imports.gi.versions.TelepathyGLib = '0.12';
 imports.gi.versions.TelepathyLogger = '0.2';
 
-const { Clutter, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Gettext = imports.gettext;
 
 // We can't import shell JS modules yet, because they may have
@@ -233,6 +233,8 @@ function init() {
     window.ngettext = Gettext.ngettext;
     window.N_ = s => s;
 
+    GObject.gtypeNameBasedOnJSPath = true;
+
     // Miscellaneous monkeypatching
     _patchContainerClass(St.BoxLayout);
 
index 33ae12d3c24fa8e574883bd49c76a028c6ed4bcc..a66f8d732036f634b4a27f42f79ff4cc36d703d2 100644 (file)
@@ -24,7 +24,7 @@ eds_req = '>= 3.17.2'
 gcr_req = '>= 3.7.5'
 gio_req = '>= 2.56.0'
 gi_req = '>= 1.49.1'
-gjs_req = '>= 1.57.3'
+gjs_req = '>= 1.63.2'
 gtk_req = '>= 3.15.0'
 mutter_req = '>= 3.35.1'
 polkit_req = '>= 0.100'